import { Component, OnInit } from '@angular/core';
import {AccountService} from '../../../service/account.service';
import {AuthService} from '../../../service/auth.service';

@Component({
  selector: 'app-edit-password',
  templateUrl: './edit-password.component.html',
  styleUrls: ['./edit-password.component.css']
})
export class EditPasswordComponent implements OnInit {
  account: any = {
    code: '', password: '', newPassword: ''
  };
  rePassword: string;
  constructor(
    public accountService: AccountService,
    public authService: AuthService
  ) {
    this.account.code = this.authService.isCompany ? this.authService.company.code : this.authService.talent.code;
  }

  editCompanyPassword() {
    this.accountService.editCompanyPassword(this.account);
  }

  editTalentPassword() {
    this.accountService.editTalentPassword(this.account);
  }

  ngOnInit() {
  }

}
